// const moment  = require('moment')

// const time = (time = new Date(), type = 'YYYY-MM-DD') => {
//     return moment(time).format(type)
// }

// module.exports = time



const moment = require('moment')

const time = (time = new Date(), type = 'YYYY-MM-DD') => {
    return moment(time).format(type)
}

console.log(time())

module.exports = time